import { SUPPLIER_CATEGORY_SELECT_LIST } from '@/pages/supplier/constants/common'
import { list2Obj } from '@/pages/supplier/utils';
import { SUPPLIER_CLASSIFY_OPTIONS } from '../../constants'

// 待考察供应商列表
const FORM_ITEM_LIST = [
  {
    prop: 'supplierCode',
    label: '供应商代码',
    type: 'input'
  },
  {
    prop: 'supplierName',
    label: '供应商名称',
    type: 'input',
  },
  {
    prop: 'supplierClassify',
    label: '供应商分类',
    type: 'select',
    clearable: true,
    options: SUPPLIER_CLASSIFY_OPTIONS,
  },
  {
    prop: 'mainCategoryId',
    label: '主营品类',
    type: 'categorySelect',
  }
]
const TABLE_COLUMNS = [
  {
    title: '供应商代码',
    key: 'supplierCode'
  },
  {
    title: '供应商名称',
    key: 'supplierName',
  },
  {
    title: '供应商管理区域',
    key: 'supplierManagerAreaName'
  },
  {
    title: '供应商分类',
    key: 'supplierClassify',
    formatter: (row, columns, cellValue) => {
      return list2Obj(SUPPLIER_CATEGORY_SELECT_LIST)[cellValue]
    }
  },
  {
    title: '主营品类代码',
    key: 'mainCategoryCode'
  },
  {
    title: '主营品类',
    key: 'mainCategory'
  },
  {
    title: '考察人',
    key: 'inspectionPersonName'
  },
  {
    title: '考察状态',
    key: 'inspectionStateName'
  },
  {
    title: '推送待办时间',
    key: 'pushTime'
  },
]
export {
  FORM_ITEM_LIST,
  TABLE_COLUMNS
}
